package com.mm.controller;

import com.mm.api.HelloApi;
import com.mm.domain.User;
import com.mm.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.serviceregistry.Registration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 不同类型的接口,用于外部调用测试
 */
@RestController
public class TestFeignController implements HelloApi{
    //非公用
    @GetMapping("/hello")
    public String hello() throws InterruptedException {
        Thread.sleep(5000l);//测试RestTemplate调用超时的时候用到
        System.out.println("hello");
        return "hello";
    }
    //公用
    @Override
    public String helloApi() {
        System.out.println("helloApi");
        return "helloApi";
    }
}
